package com.nononsenseapps.feeder.tts

import android.annotation.SuppressLint
import android.content.Context
import androidx.core.content.FileProvider

import fr.gaulupeau.apps.Poche.tts.image.AbstractAlbumArtLoaderTask
import fr.gaulupeau.apps.Poche.tts.image.ImageLoadCallback
import java.io.File

class AlbumArtLoaderTaskImpl(@SuppressLint("StaticFieldLeak") val runContext: Context, articleId:Int, imageUrl:String, cache:Boolean=true, callback: ImageLoadCallback) : AbstractAlbumArtLoaderTask(articleId,  imageUrl,  cache, callback) {

    val fileProviderAct=".filepicker_provider"

    override fun getContext(): Context {
        return runContext
    }

    override fun getUriForFile(file: File): String {
       return FileProvider.getUriForFile(runContext,runContext.applicationContext.packageName+fileProviderAct,file).toString()
    }
}